package com.kaifamiao.www.demo.do0809.ex;

public class Demo {
    public static void main(String[] args) {

        try {
            String str = "java是世界上最好的编程语言";
            str=null;
            System.out.println(str.length());

        }catch (ArithmeticException e){
            System.out.println("产生了算数异常");
            System.out.println(e.getMessage());
            e.printStackTrace();
        }catch (NullPointerException e){
            System.out.println("空指针异常");
            System.out.println(e.getMessage());
            e.printStackTrace();
        }catch (Exception e){
            e.printStackTrace();
            System.out.println("Exception");
        }finally {
            System.out.println("finally");
        }
        System.out.println("end");
    }
}
